<!DOCTYPE html>
<html class="has-navbar-fixed-top">
<head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
<title>GitHub/Gitee Pages + Hexo - HANZO</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.css">


<meta name="description" content="鬼王, HANZO, THRAEX">



<meta name="keywords" content="鬼王, O70, HANZO, THRAEX">



    <meta name="description" content="GitHub/Gitee Pages + HexoRequirements Node.js Git  Install Hexo:12345$ npm install -g hexo-cli$ npm ls -g --depth=0/usr/local/lib├── hexo-cli@1.1.0└── npm@6.4.1 若出现permission denied,请在命令前加sudo。 新建一个网站">
<meta name="keywords" content="鬼王, O70, HANZO, THRAEX">
<meta property="og:type" content="article">
<meta property="og:title" content="GitHub&#x2F;Gitee Pages + Hexo">
<meta property="og:url" content="http://yoursite.com/documents/others/github-gitee-pages-hexo.html">
<meta property="og:site_name" content="HANZO">
<meta property="og:description" content="GitHub/Gitee Pages + HexoRequirements Node.js Git  Install Hexo:12345$ npm install -g hexo-cli$ npm ls -g --depth=0/usr/local/lib├── hexo-cli@1.1.0└── npm@6.4.1 若出现permission denied,请在命令前加sudo。 新建一个网站">
<meta property="og:locale" content="en">
<meta property="og:updated_time" content="2019-07-26T04:02:09.435Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="GitHub&#x2F;Gitee Pages + Hexo">
<meta name="twitter:description" content="GitHub/Gitee Pages + HexoRequirements Node.js Git  Install Hexo:12345$ npm install -g hexo-cli$ npm ls -g --depth=0/usr/local/lib├── hexo-cli@1.1.0└── npm@6.4.1 若出现permission denied,请在命令前加sudo。 新建一个网站">





<link rel="icon" href="/images/favicon.ico">


<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Ovo|Source+Code+Pro">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css">


<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/lightgallery/1.6.8/css/lightgallery.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/justifiedGallery/3.6.5/css/justifiedGallery.min.css">


<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

<link rel="stylesheet" href="/css/style.css">

<script defer src="//use.fontawesome.com/releases/v5.0.8/js/all.js"></script>



</head>
<body>
    
<nav class="navbar is-transparent is-fixed-top navbar-main" role="navigation" aria-label="main navigation">
    <div class="container">
        <div class="navbar-brand">
            <a class="navbar-item navbar-logo" href="/">
                
                    
                    HANZO
                    
                
            </a>
            <div class="navbar-burger">
                <span></span>
                <span></span>
                <span></span>
            </div>
        </div>
        
        <div class="navbar-menu navbar-start">
            
            <a class="navbar-item " href="/categories/Technology">Technology</a>
            
            <a class="navbar-item " href="/categories/Life">Life</a>
            
            <a class="navbar-item " href="/archives">Archives</a>
            
            <a class="navbar-item " href="/about">About</a>
            
            <a class="navbar-item " href="/main">Main</a>
            
        </div>
        
        <div class="navbar-menu navbar-end">
            
            <a class="navbar-item search" title="Search" href="javascript:;">
                <i class="fas fa-search"></i>
            </a>
            
            
            
            <a class="navbar-item" title="GitHub" href="https://github.com/O70">
                
                <i class="fab fa-github"></i>
                
            </a>
               
            
        </div>
    </div>
</nav>

    <section class="section">
    <div class="container">
    <article class="article content gallery" itemscope="" itemprop="blogPost">
    <h1 class="article-title is-size-3 is-size-4-mobile" itemprop="name">
        
            GitHub/Gitee Pages + Hexo
        
    </h1>
    <div class="article-meta columns is-variable is-1 is-multiline is-mobile is-size-7-mobile">
        <span class="column is-narrow">
            <time datetime="2018-01-21T01:00:00.000Z" itemprop="datePublished">Jan 21 2018</time>
        </span>
        
        
        <span class="column is-narrow">
            
            
            2 minutes read (About 230 words)
        </span>
        
    </div>
    <div class="article-entry is-size-6-mobile" itemprop="articleBody">
    
        <h1 id="GitHub-Gitee-Pages-Hexo"><a href="#GitHub-Gitee-Pages-Hexo" class="headerlink" title="GitHub/Gitee Pages + Hexo"></a>GitHub/Gitee Pages + Hexo</h1><h2 id="Requirements"><a href="#Requirements" class="headerlink" title="Requirements"></a>Requirements</h2><ul>
<li>Node.js</li>
<li>Git</li>
</ul>
<h2 id="Install-Hexo"><a href="#Install-Hexo" class="headerlink" title="Install Hexo:"></a>Install Hexo:</h2><figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ npm install -g hexo-cli</span><br><span class="line">$ npm ls -g --depth=0</span><br><span class="line">/usr/<span class="hljs-built_in">local</span>/lib</span><br><span class="line">├── hexo-cli@1.1.0</span><br><span class="line">└── npm@6.4.1</span><br></pre></td></tr></table></figure>
<p>若出现<code>permission denied</code>,请在命令前加<code>sudo</code>。</p>
<h2 id="新建一个网站"><a href="#新建一个网站" class="headerlink" title="新建一个网站"></a>新建一个网站</h2><p><a href="https://hexo.io/zh-cn/docs/setup" target="_blank" rel="noopener">官网</a>给出以下一套命令进行建站。</p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$ hexo init &lt;folder&gt;</span><br><span class="line">$ <span class="hljs-built_in">cd</span> &lt;folder&gt;</span><br><span class="line"></span><br><span class="line">$ npm install</span><br></pre></td></tr></table></figure>
<p>在当前版本的<code>hexo-cli</code>，<code>npm install</code>不需要执行，在<code>init</code>的时候会安装相应的依赖。</p>
<h2 id="启动服务器"><a href="#启动服务器" class="headerlink" title="启动服务器"></a>启动服务器</h2><figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>
<p>默认情况下，访问网址为： <a href="http://localhost:4000。" target="_blank" rel="noopener">http://localhost:4000。</a></p>
<h2 id="Theme"><a href="#Theme" class="headerlink" title="Theme"></a>Theme</h2><p>默认主题存放于<code>&lt;folder&gt;/themes</code>下，为<code>landscape</code>。你可以从<a href="https://hexo.io/themes/" target="_blank" rel="noopener">主题列表</a>中挑选自己喜欢的主题，下载并替换。</p>
<ul>
<li><p>下载</p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="hljs-built_in">cd</span> themes/</span><br><span class="line">$ git <span class="hljs-built_in">clone</span> https://github.com/probberechts/hexo-theme-cactus.git</span><br><span class="line">$ rm -rf landscape/</span><br></pre></td></tr></table></figure>
</li>
<li><p>修改<code>_config.yml</code>文件:</p>
<figure class="highlight yaml hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="hljs-attr">theme:</span> <span class="hljs-string">hexo-theme-cactus</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>重新启动服务器进行预览</p>
<figure class="highlight bash hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>
</li>
</ul>
<!-- [hexo-theme-doc](https://zalando-incubator.github.io/hexo-theme-doc/) -->

    
    </div>
    
    
    <div class="columns is-mobile is-multiline article-nav">
        <span class="column is-12-mobile is-half-desktop  article-nav-prev">
            
            <a href="/documents/others/git-flow.html">Git Flow</a>
            
        </span>
        <span class="column is-12-mobile is-half-desktop  article-nav-next">
            
            <a href="/documents/others/you-dont-t-know-javascript.html">You Dont&#39;t Know JavaScript</a>
            
        </span>
    </div>
    
</article>





    </div>
</section>
    <footer class="footer">
    <div class="container">
        <div class="columns content">
            <div class="column is-narrow has-text-centered">
                Copyright &copy; 2019 鬼王&nbsp;
                <!-- Powered by <a href="https://github.com/O70" target="_blank">O70</a> -->
            </div>
            <div class="column is-hidden-mobile"></div>

            
            <div class="column is-narrow">
                <div class="columns is-mobile is-multiline is-centered">
                
                    
                <a class="column is-narrow has-text-black" title="京ICP备19029828号" href="http://www.miitbeian.gov.cn">
                    
                    京ICP备19029828号
                    
                </a>
                
                    
                <a class="column is-narrow has-text-black" title="GitHub" href="https://github.com/O70">
                    
                    GitHub
                    
                </a>
                
                </div>
            </div>
            
            

        </div>
    </div>
</footer>

    <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment-with-locales.min.js"></script>

<!-- test if the browser is outdated -->
<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.js"></script>
<script>
    $(document).ready(function () {
        // plugin function, place inside DOM ready function
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        })
    });
</script>

<script>
    window.FontAwesomeConfig = {
        searchPseudoElements: true
    }
    moment.locale("en-AU");
</script>



<script src="/js/script.js"></script>


    
    <div class="searchbox ins-search">
    <div class="searchbox-mask"></div>
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="Type something...">
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: 'Posts',
                PAGES: 'Pages',
                CATEGORIES: 'Categories',
                TAGS: 'Tags',
                UNTITLED: '(Untitled)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js"></script>
    
</body>
</html>
